<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);


class talent_source_model extends model
{

    public function __construct()
    {
        $this->db_config = pc_base::load_config('database');
        $this->db_setting = 'default';
        $this->table_name = 'talent_source';
        parent::__construct();
    }

    /**
     * 删除绑定关系
     */
    public function deleteBind ($id, $source_type) {

    	$where = ' source_id = ' . $id;
        
    	if ($source_type) {
    		$where .= ' and source_type = ' . $source_type;
    	}
        
        //执行删除操作
        $this->delete($where);
    }
    
    /*
     * 人才关联资源删除绑定关系
     */
    public function deleteTalentsource($talent_id) {
    	$where = "talent_id in ('$talent_id')";
    	$result = $this->delete($where);
    	return $result;
    }

}